#!/bin/ksh
#循环
ip=127.0.0.1
port=3306
DB_NAME=mysql
DBUSER=root

#sql语句
INSERT_SQL=""
UPDATE_SQL=""
DELETE_SQL=""
echo "`date +%H:%M:%S` execute start." >> create_data.log
count=0
start=`date +%s`
while((count<3000))
do
  startTime =`date +%H:%M:%S`
  startTime_s =`date +%s
  #连接数据库执行sql
  mysql -h 127.0.0.1 -P3306 -Dmysql -uroot -proot -s -e "${INSERT_SQL}"
  ((count=count+1))
  endTime =`date +%H:%M:%S`
  endTime_s =`date +%s
  totalTime =$[$endTime_s-$startTime_s]
  echo "${endTime} ----> ${startTime} time use: ${totalTime} s ,count is [${count}]." >> create_data.log
done
end =`date +%s
total = $[end-start]
echo "execute end,  total time use: ${total} s." >> create_data.log
